# # 实现斐波那契函数
# prev = 1
# current = 1
# print(current)
# for i in range(1,12):
#     print(current)
#     next = prev + current
#     prev = current
#     current = next
#
# while循环实现斐波那契函数

# try:
#     position = int(n)
#     print(list[position])
# except IndexError as err:
#     print('aaa')
# except Exception as other:
#     print('bbb')

# n = int(input("请输入一个整数:"))
# if n < 0:
#     print("请输入大于0的整数")
# elif n == 0:
#     print("当前输出0个结果")
# else:
#     print("以下是斐波那契数列的前"+str(n+1)+"个数列：")
# a, b = 0, 1
# while a < n:
#     print(a, end=' ')
#     a, b = b, a+b
# print()


# ParamsTypeError

n = int(input('输出斐波拉契数列的前n项:n='))
list = []
for m in range(0, n):
    if m == 0:
        list.append(0)
    elif m == 1:
        list.append(1)
    else:
        list.append(list[m-1]+list[m-2])
for i in range(len(list)):
    print(list[i], end=' ')